# coding=utf-8
# @Time: 2023/2/6 14:09
# @Author: zyg
# email: zhaoyiguang@lecent.cn

class LeftMenuBase:
    def level_one_menu(self, menu_name):
        """
        一级菜单栏
        :param menu_name:
        :return:
        """
        # 首页定位 //aside[@class='el-aside']//span[text()='首页']/ancestor::li
        return "//aside[@class='el-aside']//span[text()='"+menu_name+"']/ancestor::li"

    def level_two_menu(self, menu_name):
        """
        二级菜单
        :param menu_name:
        :return:
        """
        # 二级菜单 已买到的宝贝定位 //aside[@class='el-aside']//span[text()='已卖出的宝贝']/parent::li
        return "//aside[@class='el-aside']//span[text()='"+menu_name+"']/parent::li"

    def sold_treasure_menu(self, menu_name):
        """
        已卖出宝贝状态定位
        :param menu_name:
        :return:
        """
        return "//main[@class='el-main']//div[text()='" + menu_name + "']"

if __name__ == '__main__':
    print(LeftMenuBase().level_one_menu("产品"))
    print(LeftMenuBase().level_two_menu("已买到的宝贝"))
    print(LeftMenuBase().sold_treasure_menu("待评价"))
